The user has double-clicked on an entry, we work out what it was and what
to do.
1 when event = 'doubleclick' then do
2 if left(namestr,1) = '"' then
3 parse var namestr '"' namestr '"'
4 if namestr = '' then
5 fileinfo.type = 1
6 else
7 lister query handle entry '"'namestr'"' stem fileinfo.
8 if fileinfo.type > 0 then do /* it's a dir */
9 if qualifier = 'shift' then do
10 lister new
11 newhandle = result
12 address command 'Copy >NIL: T:ArcDir.list'handle 'T:ArcDir.list'newhandle
13 lister set newhandle source
14 address command 'Run >NIL: <NIL: RX DOpus5:ARexx/ArcDir.dopus5 GETDIR' portname '"'arcfile'"' newhandle arcsubdir||namestr'/'
15 end
16 else do
17 arcsubdir = arcsubdir||namestr'/'
18 call arclist
19 end
20 end
21 else
22 call viewsingle
23 end
Line:
1 Event is a doubleclick of LMB over an entry.
2 - 3 If the left character of the entry is a " then we parse the name of
the entry out from between the quotes.
4 - 7 If namestr is empty, then we assume it's a directory otherwise we do
a lister query entry on it and check it's TYPE, (this is
different from it's filetype).
8 If the TYPE is greater than 0 then it's a directory otherwise it's a
file.
9 - 15 It was a directory, we check to see whether a shift key was held
down. If it was: open a new lister, store it's handle, copy the
archive contents list to another file for the new handler, set it to
SOURCE then call ArcDir.dopus5 on it with the command GETDIR, Opus'
ARexx port name, archive filename, handle of the new lister AND the
name of the directory on which we doubleclicked.
16 - 20 Shift wasn't held down, so we add the name of the directory to the
path of the directory we are currently in and call the routine
arclist .
21 - 23 We doubleclicked on a file, so we call the viewsingle routine.
|